﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageUser.master" AutoEventWireup="true" CodeFile="News.aspx.cs" Inherits="News" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>News</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2><a href="#">News are updated daily</a></h2>
    <p>
        
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:connString %>" 
            SelectCommand="GetAllNews" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </p>
    <p>
        
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" CellPadding="3" DataKeyNames="NewsId" 
            DataSourceID="SqlDataSource1" 
            onrowdatabound="GridView1_RowDataBound" BackColor="#DEBA84" 
            BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellSpacing="2" 
            EnableModelValidation="True">
            <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <h3><asp:HyperLink ID="hplTitle" runat="server" 
                            NavigateUrl='<%# Eval("NewsId", "NewsDetails.aspx?NewsId={0}") %>' 
                            Text='<%#util.StringExtensions(Eval("Title").ToString(), 10) %>'></asp:HyperLink></h3>                            
                        <asp:Label ID="Label1" runat="server" Text=<%#util.StringExtensions(Eval("Content").ToString(), 30) %>></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
            <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
    </p>
    <p>
        
        &nbsp;</p>
    </asp:Content>

